<#include "../include/comm_jlb_macro.ftl"/>
<html>
<head>
  <title>网站后台管理系统-${pageTitle!''}管理</title>
  <link href="/css/productSetting.css" rel="stylesheet" type="text/css" />
  <@gmc_common_js "select" />
</head>
<body>
  <div class="right" data-name="tgProductSetting_add">
    <div class="location">
      <div class="location01">
        您现在的位置是：首页 &gt; <strong class="m_title"></strong>
      </div>
    </div>
    <div class="sort">
      <div class="sort1 m_title" ></div>
      <div class="query">
        <form id="addQueryForm" >
          <ul>
            <li style="width: 15%;">
              <span class="classify">礼品名称：</span>
              <input name="name" type="text"   class="input"  id="name" value="${name!''}"/>        
            </li>
            <li style="width: 15%;">
              <span class="classify">所属分类：</span>
              <select id="giftType" name="giftType" style="width: 100px;">
                <option value="" >请选择</option>
                <#list DictionaryUtil.getTypes(DictionaryType.PRODUCT_CATEGORY.getCode()) as c>            
                <option value="${c.dictionaryId}" <#if  giftType?? && giftType!="" >
                  <#if giftType?number==c.dictionaryId>selected</#if></#if>> ${c.showName!''}
                </option>
                </#list>
              </select>
            </li>
            <li style="width: 15%;">
              <span class="classify">价格区间：</span>
              <input name="start_price" type="text" class="input" style="width: 70px;" value="${start_price!''}"/>        
              --
              <input name="end_price" type="text" class="input" style="width: 70px;" value="${end_price!''}"/>        
            </li>
            <li style="width: 15%;">
              <span class="classify">礼品来源：</span>
              <select id="origin" name="origin" style="width: 100px;">
                <option value="" > 请选择 </option>
                  <#list DictionaryUtil.getTypes(DictionaryType.PRODUCT_ORIGIN.getCode()) as c>
                  <option value="${c.dictionaryId}" <#if  origin?? && origin!="" > <#if origin?number==c.dictionaryId> selected </#if> </#if>  > ${c.showName!''} </option>
                  </#list>
              </select>
            </li>
            <li style="width: 5%;">
              <button type="button" class="btn btn-default" id="addQueryBtn" >查&nbsp;询</button>
            </li>
          </ul>
        </form>
      </div>
    </div>
    <div class="form">
      <div class="form2">
        <table width="100%"  border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="#ffffff" style="border-collapse:collapse">
          <tr class="lan">
            <td style="width: 20px;" align="center" valign="middle" background="/images/erji_22.jpg">
              <input class="select-all" type="checkbox"><strong>全选</strong>
            </td>
            <td style="width: 20px;" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>序号</strong>
            </td>
            <td style="width: 50px;" height="37" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>分类</strong>
            </td>
            <td style="width: 80px;" height="37" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>礼品来源</strong>
            </td>
            <td style="width: 80px;" height="37" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>礼品名称</strong>
            </td>
            <td style="width: 30px;" height="37" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>单位</strong>
            </td>
            <td style="width: 50px;" height="37" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>价格</strong>
            </td>
          </tr>
          <#list pager.data as c>
          <tr>
            <td height="37" align="center" valign="middle" background="/images/erji_22.jpg">
              <input class="select" type="checkbox" data-id=${c.id}>
            </td>
            <td align="center" class="hui">${c_index+1}</td>
            <td align="center" class="hui">
              <#if c.category??>${DictionaryUtil.getName(c.category)}</#if>
            </td>
            <td align="center" class="hui">
              <#if c.origin??>${DictionaryUtil.getName(c.origin)}</#if>
            </td>
            <td align="center" class="hui">${c.name!''}</td>
            <td align="center" class="hui">${c.unit!''}</td>
            <td align="center" class="hui">${c.price!''}</td>
          </tr>
          </#list>
        </table>
      </div>
      <div style="clear: both;"><span class="conform-select-submit select-button">确认选择</span></div>
      <@pageBar   pager=pager url="/tgProductSetting/list.action?jsonParam=${jsonParam!''}" join="&"></@pageBar>
    </div>

    <!-- 礼品设置列表-->
    <div class="form">
      <div class="form2 productSetting">
        <table width="100%"  border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="#ffffff" style="border-collapse:collapse">
          <tr class="lan">
            <td style="width: 20px;" align="center" valign="middle" background="/images/erji_22.jpg">
              <input class="select-all" type="checkbox"><strong>全选</strong>
            </td>
            <td style="width: 20px;" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>序号</strong>
            </td>
            </td>
            <td style="width: 50px;" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>礼品分类</strong>
            </td>
            <td style="width: 80px;" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>礼品名称</strong>
            </td>
            <td style="width: 80px;" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>数量</strong>
            </td>
            <td style="width: 30px;" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>单位</strong>
            </td>
            <td style="width: 50px;" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>价格</strong>
            </td>
            <td style="width: 100px;" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>备注</strong>
            </td>
            <td style="width: 50px;" align="center" valign="middle" background="/images/erji_22.jpg">
              <strong>操 作</strong>
            </td>
          </tr>
          <#list productSettings as ps>
          <tr data-id="${ps.id}">
            <td height="37" align="center" valign="middle" background="/images/erji_22.jpg">
              <input class="select" type="checkbox" data-id="${ps.id}">
            </td>
            <td align="center" class="hui">${ps_index+1}</td>
            <#if ps.gift_type??>
            <td align="center" class="hui">
              ${DictionaryUtil.getName(ps.gift_type)}
            </td>
			<#else>
			<td align="center" class="hui">
              <select id="gift_type" name="gift_type" style="width: 180px;">
                <option value="" > 请选择 </option>
				<#list DictionaryUtil.getTypes(DictionaryType.PRESENT_ORIGIN.getCode()) as c>
				<option value="${c.dictionaryId}"> ${c.showName!''} </option>
				</#list>
              </select>
            </td>
			</#if>
            <td align="center" class="hui">${ps.product_name!''}</td>
            <td align="center" class="hui quantity"><input value="${ps.quantity!''}" readonly="readonly"/></td>
            <td align="center" class="hui">${ps.unit!''}</td>
            <td align="center" class="hui">${ps.price!''}</td>
            <td align="center" class="hui remark"><input value="${ps.remark!''}" readonly="readonly"/></td>
            <td align="center" class="hui">
              <button type="button" class="btn btn-default edit" data-id="${ps.id}">修改</button>
            </td>
          </tr>
          </#list>
        </table>
      </div>
      <div style="clear: both;"><span class="cancel-select-submit select-button">取消选择</span></div>
    </div>
  </div>
  <!-- 弹窗 结束 -->
  <#include "../include/deleteConfirmModal.ftl">
<script src="/js/productSetting.js"></script>
<script>productSetting.initPage();</script>
</html>